package site.jlopen.controller.modules;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import site.jlopen.assets.config.ThreadAuthUser;
import site.jlopen.domain.user.event.UserAccountEvent;
import site.jlopen.entity.BaseResponse;
import site.jlopen.entity.user.Datas;
import site.jlopen.service.BaseService;

@RestController
@RequestMapping("/account")
public class AccountController extends BaseService{
	private static Logger logger = LoggerFactory.getLogger(DataController.class);

	@GetMapping("/list")
	public List<UserAccountEvent> list() {
		return userService.getUserList();
	}

	@GetMapping("/rePsw")
	public BaseResponse<String> rePsw(Long userId) {
		return userService.rePsw(userId);
	}

	@GetMapping("/datas")
	public BaseResponse<Datas> datas() {
		return userService.datas(ThreadAuthUser.id());
	}
}
